
function confirmurl(url, message) {
	if (confirm(message))
		redirect(url);
}

function redirect(url) {
	location.href = url;
}

// 滚动条
$(function() {
	$(":text").addClass('input-text');
})

/**
 * 全选checkbox,注意：标识checkbox id固定为为check_box
 * 
 * @param string
 *            name 列表check名称,如 uid[]
 * 
 */
function selectall(name) {
	if ($("#check_box").attr("checked") == false || $("#check_box").attr("checked") == undefined) {
		$("input[name='" + name + "']").each(function() {
			this.checked = false;
		});
	} else {
		$("input[name='" + name + "']").each(function() {
			this.checked = true;
		});
	}
}

function openwinx(url, name, w, h) {
	if (!w)
		w = screen.width - 4;
	if (!h)
		h = screen.height - 95;

	window.open(url,name,"top=100,left=400,width="+ w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}

/**
 * 
 * @param uploadid
 * @param name
 * @param textareaid
 */
function upload(uploadid, name, textareaid) {
	window.top.art.dialog({
		title : name,
		id : uploadid,
		iframe : '/content/attachment/attachments/id/'+textareaid+'/',
		width : '500',
		height : '420'
	}, function() {
		window.top.art.dialog({
			id : uploadid
		}).close()
	});
}

// 弹出对话框
function omnipotent(id, linkurl, title, close_type, w, h) {
	if (!w){
		w = 700;
	}
		
	if (!h){
		h = 500;
	}
		
	art.dialog({
		id : id,
		iframe : linkurl,
		title : title,
		width : w,
		height : h,
		lock : true
	}, function() {
		if (close_type == 1) {
			art.dialog({
				id : id
			}).close()
		} else {
			var d = art.dialog({
				id : id
			}).data.iframe;
			var form = d.document.getElementById('dosubmit');
			form.click();
		}
		return false;
	}, function() {
		art.dialog({
			id : id
		}).close()
	});
	void (0);
}